﻿<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE HTML>
<html>
<head>
<%@include file="/common/taglibs.jsp" %>
<meta charset="utf-8" />
<meta name="renderer" content="webkit|ie-comp|ie-stand" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta http-equiv="pragma" content="no-cache" />
<LINK rel="Bookmark" href="/favicon.ico" >
<LINK rel="Shortcut Icon" href="/favicon.ico" />

<%@include file="/common/css.jsp"%>
<link href="${ctx }/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css">
<link href="${ctx }/css/style.css" rel="stylesheet" type="text/css" />
<title>H-ui.admin v2.3</title>
<meta name="keywords" content="H-ui.admin v2.3,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v2.3，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<%@include file="/common/top.jsp" %>
<%@include file="/common/menu.jsp" %>
<section class="Hui-article-box">
	<div class="Hui-article">
		<div class="cl pd-20 ">
			<div class="text-c">
				<form id="formsearch" action="${ctx }/role/gotoRoleView" method="post" class="form form-horizontal">
					<div>
		    			角色名：<input class="input-text" type="text" id="roleName" name="roleName" value="${param.roleName }" placeholder="角色名" style="width:250px">
			    		<button type="submit" class="btn btn-secondary"id="search_resource" ><i class="Hui-iconfont">&#xe665;</i>查询</button>
				    </div>
	    		</form>
			</div>
			<div class="cl pd-5">
				<span class="l">
					
				</span>
			</div>
			<a type="button" class="btn btn-primary size-S" id="roleAdd" >新增角色</a>
			<table class="table table-border table-bordered table-hover table-bg">
				<thead>
					<tr class="text-c">
						<th width="50">序列</th>
						<th width="200">角色名</th>
						<th width="100">状态</th>
						<th width="400">备注</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
				<c:forEach items="${page.data }" var="userRole" varStatus="status">
					<tr class="text-c">
						<td>${status.index+1}</td>
						<td>${userRole.roleName }</td>
						<td>${userRole.chineseStatus }</td>
						<td>${userRole.remark }</td>
						<td class="f-14">
							<div class="dropDown dropDown_click">
								<a class="btn btn-link size-MINI">操作</a>
								<div class="dropDown-menu box-shadow">
								    <ul>
										<shiro:hasPermission name="updRole">
									  		<li><a name="role_edit" data-roleid="${userRole.id }">修改</a></li>
										</shiro:hasPermission>
										<shiro:hasPermission name="startRole">
											<c:if test="${userRole.status !='1'}">
												<li><a name="role_start" data-roleid="${userRole.id }">启用</a></li>
											</c:if>
										</shiro:hasPermission>
										<shiro:hasPermission name="stopRole">
											<c:if test="${userRole.status !='2' and userRole.status !='3'}">
												<li><a name="role_stop" data-roleid="${userRole.id }">停用</a></li>
											</c:if>
										</shiro:hasPermission>
										<shiro:hasPermission name="delRole">
											<c:if test="${userRole.status !='3'}">
									  			<li><a name="role_del" data-roleid="${userRole.id }">删除</a></li>
											</c:if>
										</shiro:hasPermission>
										<shiro:hasPermission name="roleAuthManager">
									  		<li><a name="role_auth" data-roleid="${userRole.id }">授权</a></li>
										</shiro:hasPermission>
								    </ul>
								</div>
							</div>
						</td>
					</tr>
				</c:forEach>
				</tbody>
			</table>
			<div id="page_div" class="text-c mt-5"></div>
		</div>
	</div>
</section>
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-header">
		<h5><span></span></h5>
		<a class="close" data-dismiss="modal" aria-hidden="true">
			<i class="Hui-iconfont">&#xe6a6;</i>
		</a>
	</div>
	<div class="modal-body">
		<div class="text-c" id="auth_form" data-modal="">
			<form action="${ctx }/res/saveAuthType" method="post" class="form form-horizontal">
				<input type="hidden" name="roleid" id="roleid" />
				<div class="row cl">
					<div class="col-6 col-offset-3">
						<label class="form-label col-3"></label>
						<ul id="role-tree" class="ztree">
						</ul>
					</div>
				</div>
			</form>
		</div>
		<div class="text-c" id="add_role">
			<form action="${ctx }/role/saveRole" method="post" class="form form-horizontal" id="form_add_role">
				<div class="row cl">
					<label class="form-label col-3">角色名称</label>
					<div class="formControls col-6">
						<input type="hidden" id="role-id" name="id" value="" />
						<input type="text" class="input-text" autocomplete="off" placeholder="1-10个字符" name="roleName" id="role-roleName" />
					</div>
					<div class="col-4"> </div>
				</div>
				<div class="row cl">
					<label class="form-label col-3">描述：</label>
					<div class="formControls col-6">
						<textarea class="textarea" id="role-remark" name="remark"  rows="" cols=""></textarea>
					</div>
					<div class="col-4"> </div>
				</div>
			</form>
		</div>
	</div>
	<div class="modal-footer">
		<div id="add_role_btn">
			<a class="btn btn-primary submit" data-formid="#form_add_role" id="role-save" name="role-save">保存</a>
		</div>
		<div id="auth_form_btn">
			<a class="btn btn-primary" id="save_auth_btn">保存</a>
		</div>
	</div>
</div>
<%@include file="/common/js.jsp"%>
<script type="text/javascript" src="${ctx }/js/page.js"></script>
<script type="text/javascript" src="${ctx }/lib/Validform/Validform.js"></script>
<script type="text/javascript" src="${ctx }/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="${ctx }/js/sys_role.js"></script>
<script type="text/javascript">
Page.page(${page.pageNo},${page.pageSize},${page.totalCount},"formsearch");
</script>
</body>
</html>